CHANGE IN TRUNK


<h3>Add quote</h3>
<form action='<?php echo $_SERVER["PHP_SELF"]?>' method='post'>
	<p>
		<label>Quote:</label>
	</p>
	<p>
		<textarea name='quote' rows="5" cols="40"></textarea>
	</p>
	<p>
		<label>Author:</label>
		<input type="text" name="quote-author"/>
	</p>
	<p>
		<input type="submit" name='addQuote' value='Add'/>
	</p>
	<p>
		<input type="submit" name='showQuotes' value='Show All'/>
	</p>
</form>

<?php 
	//autoload function 
	function __autoload($class_name){
		require_once "classes/".$class_name.".php";
	}
	$conect = new DBconect();
	
	if(isset($_POST['addQuote'])){
		$quote=$_POST['quote'];
		$quote_author=$_POST['quote-author'];
		$conect->addQuote($quote, $quote_author);		
	}
	if(isset($_POST['showQuotes'])){
		$conect->showAllQuotes();
	}
?>

<h3>Add genre</h3>
<form action='<?php echo $_SERVER["PHP_SELF"]?>' method='post'>
	<p>
		<label>Genre:</label>
		<input type="text" name="genre"/>
	</p>
	<p>
		<input type="submit" name='addGenre' value='Add'/>
	</p>
	<p>
		<input type="submit" name='showGenres' value='Show All'/>
	</p>
</form>

<?php 
	if(isset($_POST['addGenre'])){
		$genre=$_POST['genre'];
		$conect->addGenre($genre);
	}
	
	if(isset($_POST['showGenres'])){
		
		$conect->showAllGenres();
	}
?>